package com.vecspace.sso.entity;

import java.io.Serializable;
import java.util.Date;

public class LoginToken implements Cloneable, Serializable{	

	private static final long serialVersionUID = -6620033655369486607L;
	private Date loginTime;
	private String token;
	private String loginId;
	private Long userId;
	private String userName;
	
	public LoginToken() {
		loginTime = new Date();
	}
	
	public LoginToken(String loginId){
		loginTime = new Date();
		this.loginId = loginId;
	}
	
	public String getLoginId() {
		return loginId;
	}

	public void setLoginId(String loginId) {
		this.loginId = loginId;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}
	public void setLoginTime(Date loginTime) {
		this.loginTime = loginTime;
	}
	public Date getLoginTime() {
		return loginTime;
	}
	
	public boolean successed() {
		return token != null && token.length() > 0;
	}
	
	@Override
	public Object clone() throws CloneNotSupportedException {
		return super.clone();
	}
}
